package com.iplant.mes.service.po.qms;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Calendar;

/**
 * 产品 订单 每日产量 合格率
 * @author  Femi
 * @date 2023-12-01
 */

public class QMSPassRate  {

    /**
     * 产品类型ID
     */

    public int ProductTypeID = 0;


    public String ProductTypeName = "";

    /**
     * 订单ID
     */

    public int OrderID = 0;
    /**
     * 订单号
     */

    public String OrderNo = "";


    public int ProductID = 0;


    public String ProductNo = "";

    public String ProductName = "";


    /**
     * 产品合格数
     */
    public int GoodFQTY = 0;

    /**
     *  元件报废数
     */
    public int BadComFQTY = 0;

    /**
     *  元件返工数
     */
    public int ReworkComFQTY = 0;

    /**
     *  一个产品多少个元件
     */
    public int ComNumber = 0;

    /**
     * 元件推算产品返工数
     */
    public double ReworkCom = 0;


    /**
     * 元件推算产品报废数
     */
    public double BadCom = 0.0;


    /**
     * 产品报废数
     */
    public int BadFQTY = 0;


    public Calendar RateDate = Calendar.getInstance();


    @JsonProperty("ProductTypeID")
    public int getProductTypeID() {
        return ProductTypeID;
    }

    public void setProductTypeID(int productTypeID) {
        ProductTypeID = productTypeID;
    }

    @JsonProperty("ProductTypeName")
    public String getProductTypeName() {
        return ProductTypeName;
    }

    public void setProductTypeName(String productTypeName) {
        ProductTypeName = productTypeName;
    }

    @JsonProperty("OrderID")
    public int getOrderID() {
        return OrderID;
    }

    public void setOrderID(int orderID) {
        OrderID = orderID;
    }

    @JsonProperty("OrderNo")
    public String getOrderNo() {
        return OrderNo;
    }

    public void setOrderNo(String orderNo) {
        OrderNo = orderNo;
    }

    @JsonProperty("ProductID")
    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int productID) {
        ProductID = productID;
    }

    @JsonProperty("ProductNo")
    public String getProductNo() {
        return ProductNo;
    }

    public void setProductNo(String productNo) {
        ProductNo = productNo;
    }

    @JsonProperty("ProductName")
    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    @JsonProperty("GoodFQTY")
    public int getGoodFQTY() {
        return GoodFQTY;
    }

    public void setGoodFQTY(int goodFQTY) {
        GoodFQTY = goodFQTY;
    }

    @JsonProperty("BadComFQTY")
    public double getBadComFQTY() {
        return BadComFQTY;
    }

    public void setBadComFQTY(int badComFQTY) {
        BadComFQTY = badComFQTY;
        if (ComNumber <= 0)
            ComNumber = 1;
        BadCom = BadComFQTY / ComNumber;
    }

    @JsonProperty("ComNumber")
    public int getComNumber() {
        return ComNumber;
    }

    public void setComNumber(int comNumber) {
        ComNumber = comNumber;
        if (ComNumber <= 0)
            ComNumber = 1;
        BadCom = BadComFQTY / ComNumber;

        ReworkCom = ReworkComFQTY / ComNumber;
    }

    @JsonProperty("BadCom")
    public double getBadCom() {


        if (ComNumber <= 0)
            ComNumber = 1;
        BadCom = BadComFQTY / ComNumber;

        return BadCom;
    }

    @JsonProperty("ReworkComFQTY")
    public int getReworkComFQTY() {
        return ReworkComFQTY;
    }

    public void setReworkComFQTY(int reworkComFQTY) {
        ReworkComFQTY = reworkComFQTY;
    }

    @JsonProperty("ReworkCom")
    public double getReworkCom() {
        if (ComNumber <= 0)
            ComNumber = 1;
        ReworkCom = ReworkComFQTY / ComNumber;
        return ReworkCom;
    }

    public void setReworkCom(double reworkCom) {
        ReworkCom = reworkCom;
    }

    public void setBadCom(double badCom) {

    }

    @JsonProperty("BadFQTY")
    public int getBadFQTY() {
        return BadFQTY;
    }

    public void setBadFQTY(int badFQTY) {
        BadFQTY = badFQTY;
    }

    @JsonProperty("RateDate")
    public Calendar getRateDate() {
        return RateDate;
    }

    public void setRateDate(Calendar rateDate) {
        RateDate = rateDate;
    }
}
